<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/




/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/


Route::group(['middleware' => ['web']], function () {
    Route::get('/',['as'=>'Home.Index.index','uses'=>'HomeController@index']);
    Route::get('contact',['as' => 'Home.Index.contact','uses' => 'HomeController@contact']);
    Route::get('environmental-list',['as' => 'Home.Index.environmentalList' , 'uses' => 'HomeController@environmentalList']);
    Route::get('environmental-detail',['as' => 'Admin.Home.environmentalDetail' , 'uses' => 'HomeController@environmentalDetail']);
    Route::get('news-list',['as' => 'Home.Index.newsList','uses' => 'HomeController@newsList']);
    Route::get('news-detail',['as' => 'Admin.Home.newsDetail' , 'uses' => 'HomeController@newsDetail']);
    Route::get('about-detail',['as' => 'Admin.Home.aboutDetail' , 'uses' => 'HomeController@aboutDetail']);
    Route::get('charitable-list',['as' => 'Home.Index.charitableList' , 'uses' => 'HomeController@charitableList']);
    Route::get('charitable-detail',['as' => 'Admin.Home.CharitableDetail' , 'uses' => 'HomeController@CharitableDetail']);
    Route::get('project-case-list',['as' => 'Home.Index.projectCaseList','uses' => 'HomeController@projectCaseList']);
    Route::get('project-case-detail',['as' => 'Admin.Home.ProjectCaseDetail' , 'uses' => 'HomeController@ProjectCaseDetail']);

    Route::group(['prefix' => 'en'],function(){
        Route::get('/',['as'=>'Home.Index.enIndex','uses'=>'EnHomeController@enIndex']);
        Route::get('en-contact',['as' => 'Home.Index.enContact','uses' => 'EnHomeController@enContact']);
        Route::get('en-about-detail',['as' => 'Admin.Home.enAboutDetail' , 'uses' => 'EnHomeController@enAboutDetail']);
        Route::get('en-environmental-list',['as' => 'Home.Index.enEnvironmentalList' , 'uses' => 'EnHomeController@enEnvironmentalList']);
        Route::get('en-environmental-detail',['as' => 'Admin.Home.enEnvironmentalDetail' , 'uses' => 'EnHomeController@enEnvironmentalDetail']);
        Route::get('en-news-list',['as' => 'Home.Index.enNewsList','uses' => 'EnHomeController@enNewsList']);
        Route::get('en-news-detail',['as' => 'Admin.Home.enNewsDetail' , 'uses' => 'EnHomeController@enNewsDetail']);
        Route::get('en-project-case-list',['as' => 'Home.Index.enProjectCaseList' , 'uses' => 'EnHomeController@enProjectCaseList']);
        Route::get('en-project-case-detail',['as' => 'Admin.Home.enProjectCaseDetail' , 'uses' => 'EnHomeController@enProjectCaseDetail']);
        Route::get('en-charitable-list',['as' => 'Home.Index.enCharitableList' , 'uses' => 'EnHomeController@enCharitableList']);
        Route::get('en-charitable-detail',['as' => 'Admin.Home.enCharitableDetail' , 'uses' => 'EnHomeController@enCharitableDetail']);

    });

    Route::group(['prefix'=>'admin'],function(){
        Route::get('login',['as' => 'Admin.Home.login', 'uses' => 'AdminController@login']);
        Route::get('user-list',['as' => 'Admin.Home.userList', 'uses' => 'AdminController@userList']);

        Route::get('banner-list',['as' => 'Admin.Home.bannerList', 'uses' => 'AdminController@bannerList']);
        Route::get('banner-set',['as' => 'Admin.Home.bannerSet', 'uses' => 'AdminController@bannerSet']);
        Route::get('en-banner-list',['as' => 'Admin.Home.enBannerList', 'uses' => 'AdminController@enBannerList']);
        Route::get('en-banner-set',['as' => 'Admin.Home.enBannerSet', 'uses' => 'AdminController@enBannerSet']);

        Route::get('change-Pwd',['as' => 'Admin.Home.changePwd', 'uses' => 'AdminController@changePwd']);
        Route::get('admin-list',['as' => 'Admin.Home.adminList' , 'uses' => 'AdminController@adminList']);
        Route::get('admin-set',['as' => 'Admin.Home.adminSet' , 'uses' => 'AdminController@adminSet']);
        Route::get('classify-list',['as' => 'Admin.Home.classifyList' , 'uses' => 'AdminController@classifyList']);
        Route::get('en-classify-list',['as' => 'Admin.Home.enClassifyList' , 'uses' => 'AdminController@enClassifyList']);

        Route::get('webSite-info',['as' => 'Admin.Home.webSiteInfo' , 'uses' => 'AdminController@webSiteInfo']);
        Route::get('en_webSite-info',['as' => 'Admin.Home.enWebSiteInfo' , 'uses' => 'AdminController@enWebSiteInfo']);

        Route::get('footer-menu',['as' => 'Admin.Home.footerMenu' , 'uses' => 'AdminController@footerMenu']);
        Route::get('footer-menu-child',['as' => 'Admin.Home.footerMenuChild' , 'uses' => 'AdminController@footerMenuChild']);
        Route::get('en-footer-menu',['as' => 'Admin.Home.enFooterMenu' , 'uses' => 'AdminController@enFooterMenu']);
        Route::get('en-footer-menu-child',['as' => 'Admin.Home.enFooterMenuChild' , 'uses' => 'AdminController@enFooterMenuChild']);

        Route::get('achievement-list',['as' => 'Admin.Home.achievementList' , 'uses' => 'AdminController@achievementList']);
        Route::get('achievement-set',['as' => 'Admin.Home.achievementSet' , 'uses' => 'AdminController@achievementSet']);
        Route::get('en-achievement-list',['as' => 'Admin.Home.enAchievementList' , 'uses' => 'AdminController@enAchievementList']);
        Route::get('en-achievement-set',['as' => 'Admin.Home.enAchievementSet' , 'uses' => 'AdminController@enAchievementSet']);

        Route::get('philanthropy-list',['as' => 'Admin.Home.philanthropyList' , 'uses' => 'AdminController@philanthropyList']);
        Route::get('en-philanthropy-list',['as' => 'Admin.Home.enPhilanthropyList' , 'uses' => 'AdminController@enPhilanthropyList']);
        Route::get('philanthropy-set',['as' => 'Admin.Home.philanthropySet' , 'uses' => 'AdminController@philanthropySet']);
        Route::get('en-philanthropy-set',['as' => 'Admin.Home.enPhilanthropySet' , 'uses' => 'AdminController@enPhilanthropySet']);

        Route::get('news-list',['as' => 'Admin.Home.newsList' , 'uses' => 'AdminController@newsList']);
        Route::get('en-news-list',['as' => 'Admin.Home.enNewsList' , 'uses' => 'AdminController@enNewsList']);
        Route::get('news-set',['as' => 'Admin.Home.newsSet' , 'uses' => 'AdminController@newsSet']);
        Route::get('en-news-set',['as' => 'Admin.Home.enNewsSet' , 'uses' => 'AdminController@enNewsSet']);
        Route::get('project-case-list',['as' => 'Admin.Home.projectCaseList' , 'uses' => 'AdminController@projectCaseList']);
        Route::get('project-case-set',['as' => 'Admin.Home.projectCaseSet' , 'uses' => 'AdminController@projectCaseSet']);
        Route::get('en-project-case-list',['as' => 'Admin.Home.enProjectCaseList' , 'uses' => 'AdminController@enProjectCaseList']);
        Route::get('en-project-case-set',['as' => 'Admin.Home.enProjectCaseSet' , 'uses' => 'AdminController@enProjectCaseSet']);
        Route::get('environmental-list',['as' => 'Admin.Home.environmentalList' , 'uses' => 'AdminController@environmentalList']);
        Route::get('environmental-set',['as' => 'Admin.Home.environmentalSet' , 'uses' => 'AdminController@environmentalSet']);
        Route::get('en-environmental-list',['as' => 'Admin.Home.enEnvironmentalList' , 'uses' => 'AdminController@enEnvironmentalList']);
        Route::get('en-environmental-set',['as' => 'Admin.Home.enEnvironmentalSet' , 'uses' => 'AdminController@enEnvironmentalSet']);
        Route::get('environmental-classify-list',['as' => 'Admin.Home.environmentalClassifyList' , 'uses' => 'AdminController@environmentalClassifyList']);
        Route::get('en-environmental-classify-list',['as' => 'Admin.Home.enEnvironmentalClassifyList' , 'uses' => 'AdminController@enEnvironmentalClassifyList']);

        Route::get('about-us-list',['as' => 'Admin.Home.aboutUsList' , 'uses' => 'AdminController@aboutUsList']);
        Route::get('en-about-us-list',['as' => 'Admin.Home.enAboutUsList' , 'uses' => 'AdminController@enAboutUsList']);
        Route::get('about-us-set',['as' => 'Admin.Home.aboutUsSet' , 'uses' => 'AdminController@aboutUsSet']);
        Route::get('en-about-us-set',['as' => 'Admin.Home.enAboutUsSet' , 'uses' => 'AdminController@enAboutUsSet']);
        Route::get('about-us-classify-list',['as' => 'Admin.Home.aboutUsClassifyList' , 'uses' => 'AdminController@aboutUsClassifyList']);
        Route::get('en-about-us-classify-list',['as' => 'Admin.Home.enAboutUsClassifyList' , 'uses' => 'AdminController@enAboutUsClassifyList']);

        Route::get('comment-list',['as' => 'Admin.Home.commentList' , 'uses' => 'AdminController@commentList']);
        Route::get('en-comment-list',['as' => 'Admin.Home.enCommentList' , 'uses' => 'AdminController@enCommentList']);
        Route::get('comment-set',['as' => 'Admin.Home.commentSet' , 'uses' => 'AdminController@commentSet']);
        Route::get('en-comment-set',['as' => 'Admin.Home.enCommentSet' , 'uses' => 'AdminController@enCommentSet']);

        Route::get('volunteer-list',['as' => 'Admin.Home.volunteerList' , 'uses' => 'AdminController@volunteerList']);
        Route::get('online-message-list',['as' => 'Admin.Home.onlineMessageList' , 'uses' => 'AdminController@onlineMessageList']);
        Route::get('charitable-list',['as' => 'Admin.Home.charitableList' , 'uses' => 'AdminController@charitableList']);
        Route::get('charitable-set',['as' => 'Admin.Home.charitableSet' , 'uses' => 'AdminController@charitableSet']);
        Route::get('en-charitable-list',['as' => 'Admin.Home.enCharitableList' , 'uses' => 'AdminController@enCharitableList']);
        Route::get('en-charitable-set',['as' => 'Admin.Home.enCharitableSet' , 'uses' => 'AdminController@enCharitableSet']);

    });

    Route::group(['prefix'=>'api', 'namespace'=>'Api','middleware' => ['cors']],function(){
        Route::group(['prefix' => 'admin','namespace'=>'Admin'],function(){
            Route::post('auth/sign-in',['as'=>'Api.Admin.Auth.signInAdmin','uses'=>'AuthController@signInAdmin']);
            Route::post('auth/change-pwd',['as'=>'Api.Admin.Auth.changePassword','uses'=>'AuthController@changePassword']);
            Route::get('auth/signOut',['as'=>'Api.Admin.Auth.signOut','uses'=>'AuthController@signOut']);
            Route::post('sys/setBanner',['as'=>'Api.Admin.sys.setBanner','uses'=>'SystemController@setBanner']);
            Route::post('sys/delBanner',['as'=>'Api.Admin.sys.delBanner','uses'=>'SystemController@delBanner']);
            Route::post('sys/setAdmin',['as' => 'Api.Admin.sys.setAdmin','uses' => 'SystemController@setAdmin']);
            Route::post('sys/delAdmin',['as'=>'Api.Admin.sys.delAdmin','uses'=>'SystemController@delAdmin']);
            Route::post('sys/addClassify',['as'=>'Api.Admin.sys.addClassify','uses'=>'SystemController@addClassify']);
            Route::post('sys/delClassify',['as'=>'Api.Admin.sys.delClassify','uses'=>'SystemController@delClassify']);
            Route::post('sys/setWebSiteInfo',['as'=>'Api.Admin.sys.setWebSiteInfo','uses'=>'SystemController@setWebSiteInfo']);
            Route::post('sys/setEnWebSiteInfo',['as'=>'Api.Admin.sys.setEnWebSiteInfo','uses'=>'SystemController@setEnWebSiteInfo']);
            Route::post('sys/addFooterMenu',['as'=>'Api.Admin.sys.addFooterMenu','uses'=>'SystemController@addFooterMenu']);
            Route::post('sys/addEnFooterMenu',['as'=>'Api.Admin.sys.addEnFooterMenu','uses'=>'SystemController@addEnFooterMenu']);
            Route::post('sys/delFooterMenu',['as'=>'Api.Admin.sys.delFooterMenu','uses'=>'SystemController@delFooterMenu']);
            Route::post('sys/delEnFooterMenu',['as'=>'Api.Admin.sys.delEnFooterMenu','uses'=>'SystemController@delEnFooterMenu']);
            Route::post('sys/setGoods',['as'=>'Api.Admin.sys.setGoods','uses'=>'SystemController@setGoods']);
            Route::post('sys/delGoods',['as'=>'Api.Admin.sys.delGoods','uses'=>'SystemController@delGoods']);
            Route::post('sys/addAllClassify',['as'=>'Api.Admin.sys.addAllClassify','uses'=>'SystemController@addAllClassify']);
            Route::post('sys/delAllClassify',['as'=>'Api.Admin.sys.delAllClassify','uses'=>'SystemController@delAllClassify']);
            Route::post('sys/setNews',['as'=>'Api.Admin.sys.setNews','uses'=>'SystemController@setNews']);
            Route::post('sys/delNews',['as'=>'Api.Admin.sys.delNews','uses'=>'SystemController@delNews']);
            Route::post('sys/setProjectCase',['as'=>'Api.Admin.sys.setProjectCase','uses'=>'SystemController@setProjectCase']);
            Route::post('sys/delProjectCase',['as'=>'Api.Admin.sys.delProjectCase','uses'=>'SystemController@delProjectCase']);
            Route::post('sys/setEnvironmental',['as'=>'Api.Admin.sys.setEnvironmental','uses'=>'SystemController@setEnvironmental']);
            Route::post('sys/delEnvironmental',['as'=>'Api.Admin.sys.delEnvironmental','uses'=>'SystemController@delEnvironmental']);
            Route::post('sys/setAboutUs',['as'=>'Api.Admin.sys.setAboutUs','uses'=>'SystemController@setAboutUs']);
            Route::post('sys/delAboutUs',['as'=>'Api.Admin.sys.delAboutUs','uses'=>'SystemController@delAboutUs']);
            Route::post('sys/setHumanRes',['as'=>'Api.Admin.sys.setHumanRes','uses'=>'SystemController@setHumanRes']);
            Route::post('sys/delHumanRes',['as'=>'Api.Admin.sys.delHumanRes','uses'=>'SystemController@delHumanRes']);
            Route::post('sys/setApplicationField',['as'=>'Api.Admin.sys.setApplicationField','uses'=>'SystemController@setApplicationField']);
            Route::post('sys/delApplicationField',['as'=>'Api.Admin.sys.delApplicationField','uses'=>'SystemController@delApplicationField']);
            Route::post('sys/setCharitable',['as'=>'Api.Admin.sys.setCharitable','uses'=>'SystemController@setCharitable']);
            Route::post('sys/delCharitable',['as'=>'Api.Admin.sys.delCharitable','uses'=>'SystemController@delCharitable']);
            Route::post('sys/addOnline',['as'=>'Api.Admin.sys.addOnline','uses'=>'SystemController@addOnline']);
            Route::post('sys/changeSectionNav',['as'=>'Api.Admin.sys.changeSectionNav','uses'=>'SystemController@changeSectionNav']);
            Route::post('sys/changeSectionStatus',['as'=>'Api.Admin.sys.changeSectionStatus','uses'=>'SystemController@changeSectionStatus']);

        });

        Route::group(['prefix' => 'wx'],function(){
            Route::any('getJsApiPacket',['as'=>'Api.Wechat.getJsApiPacket','uses'=>'WechatController@getJsApiPacket']);
        });

        Route::get('joinVolunteerApply',['as' => 'Api.Index.joinVolunteerApply' , 'uses' => 'IndexController@joinVolunteerApply']);

        Route::group(['prefix' => 'file'],function(){
            Route::post('upload-img',['as'=>'Api.File.upload','uses'=>'ImageController@upload']);
            Route::post('upload-audio',['as'=>'Api.File.uploadAudio','uses'=>'ImageController@uploadAudio']);
            Route::get('show-image/{id}',['as'=>'Api.File.showImageById','uses'=>'ImageController@showImageById']);
            Route::get('reloadImages',['as'=>'Api.File.reloadImages','uses'=>'ImageController@reloadImages']);
            Route::post('uploadBase64Image',['as'=>'Api.File.uploadBase64Image','uses'=>'ImageController@uploadBase64Image']);
            Route::post('upload-user-photo',['as'=>'Api.File.uploadUserPhoto','uses'=>'ImageController@uploadUserPhoto']);
        });

        Route::group(['prefix' => 'audio'],function(){
            Route::get('upload-audio/{audio_id}',['as'=>'Api.Audio.getAudioUrl','uses'=>'AudioController@getAudioUrl']);
       });

        Route::group(['prefix' => 'auth'],function(){
            Route::get('wxLogin',['as'=>'Api.Auth.wxLogin','uses'=>'AuthController@wxLogin']);
            Route::get('goToUrl',['as'=>'Api.Auth.goToUrl','uses'=>'AuthController@goToUrl']);
            Route::any('wechatCallback',['as'=>'Api.Auth.wechatCallback','uses'=>'AuthController@wechatCallback']);
            Route::post('buildOnlineMessage',['as'=>'Api.Auth.buildOnlineMessage','uses'=>'AuthController@buildOnlineMessage']);
        });

        Route::group(['prefix' => 'other'],function(){
            Route::get('getBannerList',['as'=>'Api.Order.getBannerList','uses'=>'OtherController@getBannerList']);
        });
    });
});
